package idv.takeshi.software.productline.bookstore.application.service;

import java.util.Locale;


import idv.takeshi.software.productline.bookstore.domain.model.category.Category;
import idv.takeshi.software.productline.bookstore.domain.model.deliveryservice.DeliveryService;
import idv.takeshi.software.productline.bookstore.domain.model.order.Order;
import idv.takeshi.software.productline.bookstore.domain.model.order.OrderDuplicateException;
import idv.takeshi.software.productline.bookstore.domain.model.useraccount.UserAccount;

/**
 * A service for placing order operation.
 * @author takeshi
 *
 */
public interface PlaceOrderService {
	
	/**
	 * Get delivery service by id
	 * @param id
	 * @return
	 */
	public DeliveryService getDeliveryServiceById(Integer id);

	/**
	 * Persist a newly created order with the given userAccount,
	 * then send mail to notify both this customer & all clerks.
	 * @param userAccount
	 * @param newOrder
	 * @param locale
	 * @throws OrderDuplicateException 
	 */
	public void persistNewOrder(Long userAccountId, Order newOrder, Locale locale)
			throws OrderDuplicateException;
	
	/**
	 * Get order by order id.
	 * @param orderId
	 * @return
	 */
	public Order getOrderById(Long orderId);
	
}
